1 00:00:00,600 --> 00:00:08,880 Hello and welcome to this lecture in this little shop will be creating a few variables that we will 2 00:00:09,090 --> 00:00:19,900 use later to create a paddle that we can use to hit the ball later on in the game. 3 00:00:20,070 --> 00:00:32,010 We need the paddle to have a height and also a with will also need to know where the paddle will point 4 00:00:32,190 --> 00:00:33,150 from. 5 00:00:33,180 --> 00:00:41,430 For example want the starting point on the x axis or x coordinate that we're will use later on in the 6 00:00:41,430 --> 00:00:49,880 game to perform some calculations that we can use to determine the movement of the ball and the paddle. 7 00:00:50,880 --> 00:00:51,600 Okay. 8 00:00:51,630 --> 00:00:55,130 Let's start defining the variables for the paddle. 9 00:00:55,190 --> 00:01:02,670 So these is the jabb Us group so far we are going to define the variables where the other variables 10 00:01:02,670 --> 00:01:04,470 are where we find them. 11 00:01:04,470 --> 00:01:12,780 So we're just going to get a tap down and type in the world var for variable. 12 00:01:13,950 --> 00:01:25,740 I'm going to call the variable paddle height. 13 00:01:26,760 --> 00:01:27,420 Okay. 14 00:01:27,460 --> 00:01:30,750 An hour give it a value of 15 00:01:34,010 --> 00:01:34,840 12. 16 00:01:37,970 --> 00:01:45,740 Let's create another variable called paddle with. 17 00:01:54,050 --> 00:02:02,740 Now give this a wave off 72. 18 00:02:04,750 --> 00:02:14,480 Next we want to define a variable that will specify where the starting point or the puddle be from the 19 00:02:14,570 --> 00:02:17,840 x axis or x coordinate. 20 00:02:17,870 --> 00:02:30,670 So we do that by defining a variable for that I'll call it variable How do you do it. 21 00:02:30,690 --> 00:02:35,830 Bandeau X which will be obar case X.. 22 00:02:36,470 --> 00:02:39,020 So don't confuse the variable. 23 00:02:39,020 --> 00:02:40,820 This is an upper case x. 24 00:02:40,820 --> 00:02:47,840 Notice that what like is variables or already set up so this variable that will terminate a starting 25 00:02:47,840 --> 00:02:50,520 point for the paddle on the x axis. 26 00:02:50,510 --> 00:02:56,920 I've called it pad all x and the values have given it. 27 00:02:57,220 --> 00:03:08,620 This will be the canvass week minus the power door with divided by 2 right. 28 00:03:08,630 --> 00:03:14,510 So with the value that will be well then close then parenthesis 29 00:03:17,470 --> 00:03:21,520 come big come laughs. 30 00:03:26,830 --> 00:03:29,340 Dealt with. 31 00:03:32,520 --> 00:03:35,260 Remind us. 32 00:03:37,160 --> 00:03:40,490 Paddle with them. 33 00:03:40,510 --> 00:03:45,080 We've got a variable quad paddle we thought to be the come bass. 34 00:03:45,460 --> 00:03:46,150 Yeah. 35 00:03:46,510 --> 00:03:48,820 Dont we. 36 00:03:48,980 --> 00:03:55,030 So this is the matter with my in-laws with minus the paddle with. 37 00:03:55,250 --> 00:04:00,570 And then we go in to divide that value in half. 38 00:04:00,570 --> 00:04:02,520 So going to divide by two. 39 00:04:02,810 --> 00:04:13,190 So this paddle X back is x variable will be was to become of us dot the width of the comebacks minus 40 00:04:13,550 --> 00:04:17,580 the paddle with divided by two. 41 00:04:21,200 --> 00:04:21,750 Okay. 42 00:04:21,780 --> 00:04:25,360 So we've got our variable dis defined. 43 00:04:25,360 --> 00:04:26,750 Let me run through them again. 44 00:04:26,760 --> 00:04:35,340 The first was a variable to determine the height of the paddle and have called it pad or height and 45 00:04:35,340 --> 00:04:37,480 giving a value of 12. 46 00:04:37,560 --> 00:04:45,090 The next is the variable paddle with which will determine the width of the paddle how long the paddle 47 00:04:45,090 --> 00:04:49,560 will be given it's 72 pixels is aim pixels. 48 00:04:49,560 --> 00:04:58,050 When we finally have defined another variable or paddle x axis x that will determine where the paddle 49 00:04:58,440 --> 00:05:06,930 will start from on the x axis or wad in it and I've given the value of canvas that is in full canvas 50 00:05:07,710 --> 00:05:09,490 with the with the compass. 51 00:05:09,510 --> 00:05:17,080 My in-laws the paddle with divided by two so that would be the starting point. 52 00:05:17,150 --> 00:05:25,470 The width of the come vase minus the width of the panel provided by to thank you so much for watching 53 00:05:25,770 --> 00:05:26,730 the next leg. 54 00:05:26,730 --> 00:05:35,580 Sure we will create a function that will draw the paddle by half an hour.